package com.wanwu.channel.remote.allinpay.TLHttpUtils;


import org.apache.commons.lang3.ArrayUtils;

/**
 * @author JiWen
 * @time 2020/1/21 09:51
 */
public class TLTradeStat {

    /**
     * 所有的编码
     */
    private final static String[] allStatus = {"01", "02", "03", "04", "05", "06", "07", "08"};
    /*
    中间态：
        01	待审核
        03	处理中
        06	已发送渠道
        08	待发送
     */
    private final static String[] middleStatus = {"01", "03", "06", "08"};
    /*
    终止态：
        02	审核不通过
        04	处理成功
        05	处理失败
        07	交易已关闭
     */
    private final static String[] failStatus = {"02", "05", "07"};
    private final static String[] successStatus = {"04"};

    public static Boolean isFinish(String state) {
        return ArrayUtils.contains(successStatus, state) || ArrayUtils.contains(failStatus, state);
    }

    public static Boolean isMiddle(String state) {
        return ArrayUtils.contains(middleStatus, state);
    }

    public static Boolean isSuccess(String state) {
        return ArrayUtils.contains(successStatus, state);
    }

    public static Boolean isFail(String state) {
        return ArrayUtils.contains(failStatus, state);
    }

}
